<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{$GLOBALS['cfg_webname']}-用户资料</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="会员中心">
    <meta name="author" content="歪酷CMS">
    <link href="__PUBLIC__/User/css/bootstrap.min.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
    </style>
    <link href="__PUBLIC__/User/css/bootstrap-responsive.min.css" rel="stylesheet"/>
	<link href="__PUBLIC__/Editor/kindeditor/themes/default/default.css" type="text/css" rel="stylesheet">
  </head>
  <body>
    <include file="Public:head"/>
    <div class="container-fluid">
      <div class="row-fluid">
       <include file="Public:left"/>
		<div class="span9">
			<div class="navbar">
				<div class="navbar-inner">
					<a class="brand">用户资料</a>
					<ul class="nav">
		<li ><a href="{:U('Index/myfile')}">预览资料</a></li>
		<li><a href="{:U('Index/myfile?edit=base')}">修改资料</a></li>
		<li class="active"><a href="{:U('Index/myfile?edit=password')}">密码安全</a></li>
		</ul>
				</div>
			</div>
		</div>
        <div class="span9" style='border:1px solid #ccc;margin-bottom:10px;'>
		<div style="padding:20px">
		<form class="form-horizontal" name="UserReg" action="{:U('Index/dorepassword')}" onsubmit="return CheckForm()" method="post">
		<div class="control-group">
			<label class="control-label" for="inputEmail">旧的密码</label>
			<div class="controls">
				<input type="password" name="oldpassword" id="oldpassword" placeholder="输入密码..."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">新的密码</label>
			<div class="controls">
				<input type="password" name="password" id="password" placeholder="输入密码..."/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label" for="inputEmail">确认新密码</label>
			<div class="controls">
				<input type="password" name="repassword" id="repassword" placeholder="输入密码..."/>
			</div>
		</div>
		<?php if(C('SOFT_VERIFY') <>1):?>
		<div class="control-group">
			<label class="control-label" for="inputEmail">验证码</label>
			<div class="controls">
				<input class="input-mini" type="text" name="verify" id="verify" style="text-transform:uppercase;"/><img src="{:U('Public/verify?rand=')}{:uniqid()}" alt="看不清楚请点击刷新验证码" style="cursor : pointer;border:1px solid #ccc;margin-left:2px;" onclick="show(this)"/>
			</div>
		</div>
		<?php endif; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary btn-large">修改</button>
				<button type="reset" class="btn btn-inverse btn-large">重置</button>
			</div>
		</div>
		</form>
		</div></div>
      

	 </div>
		

      <hr/>

    <include file="Public:footer"/>

    </div>
	<script charset="utf-8" src="__PUBLIC__/Common/Jquery/Jquery.js"></script>
	<script charset="utf-8" src="__PUBLIC__/Common/artDialog/jquery.artDialog.js?skin=twitter"></script>
	<script charset="utf-8" src="__PUBLIC__/Common/artDialog/extend.js"></script>  
	<script charset="utf-8" src="__PUBLIC__/Editor/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/Editor/kindeditor/lang/zh_CN.js"></script>
<script>
function show(obj){
obj.src="{:U('Public/verify?random=1')}"+ Math.random();
}
	KindEditor.ready(function(K) { 
	var editor = K.editor({ allowFileManager : true,removeSize:true,removeAlign:true,removeTitle:true,resizeImage:true}); 
	K('#50e5974b00984').click(function() {
	editor.loadPlugin('image', function() 
	{ 
	editor.plugin.imageDialog({ 
	imageUrl :'', 
	clickFn : function(url,title) 
	{ 
		K("#avtar").val(url);
		K("#preavtar").html("<img src='"+url+"' width='100px' height='100px'/>");
		editor.hideDialog(); 
	} 
	});
	}); 
	}); 
	});
	function CheckForm()
	{ 
		if(EmptyCheckForm('oldpassword','原始密码不能为空!',''))return false;
		if(EmptyCheckForm('password','新的密码不能为空!',''))return false;
		if(EmptyCheckForm('repassword','确认新的密码不能为空!',''))return false;
		if(RepwdCheckForm('password','repassword','确认新密码和新的密码不一致!'))return false;
		if(OldpwdCheckForm('oldpassword','password','新密码和原始密码相同!'))return false;
		if(PwdlenthCheckForm('password','新密码位数要求必须大于{$GLOBALS.cfg_mb_pwdmin}!'))return false;
		<?php if(C('SOFT_VERIFY') <>1):?>
		if(EmptyCheckForm('verify','验证码不能为空!',''))return false;
		<?php endif;?>
	}
	function EmptyCheckForm(id,value,set)
	{
		if($('#'+id).val()==set)
		{
			$.dialog({icon:'warning',content:value,ok:function(){ $('#' + id).focus();}});return true;
		}
		return false;
	}

	
	function RepwdCheckForm(id1,id2,msg)
	{
		if($('#'+id1).val() != $('#'+id2).val())
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id1).focus();}});return true;
		}
		return false;
	}
	function OldpwdCheckForm(id1,id2,msg)
	{
		if($('#'+id1).val() == $('#'+id2).val())
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id1).focus();}});return true;
		}
		return false;
	}
	
	function PwdlenthCheckForm(id,msg)
	{
		var lenth = '{$GLOBALS.cfg_mb_pwdmin}';
		if($('#'+id).val().length < lenth)
		{
			$.dialog({icon:'warning',content:msg,ok:function(){ $('#' + id).focus();}});return true;
		}
		return false;
	}
</script>
  </body>
</html>
